<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script>
    const c = () => {
      const w = document.documentElement.clientWidth
      const n = (20 * (w / 320) > 40 ? 40 + 'px' : 20 * (w / 320) + 'px')
      document.documentElement.style.fontSize = n
    }
    window.addEventListener('load', c)
    window.addEventListener('resize', c)
  </script>
  <style>
    html{
      /* font-size: 10px; */
    }

  </style>

</head>
<body>
  123
</body>
</html>
